package com.ruoyi.hospital.mapper;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.ruoyi.hospital.domain.CustomerBalance;
import org.apache.ibatis.annotations.Param;

/**
 * 会员余额Mapper接口
 *
 * @author qichi
 * @date 2023-07-04
 */
public interface CustomerBalanceMapper {
    /**
     * 查询会员余额
     *
     * @param id 会员余额主键
     * @return 会员余额
     */
    public CustomerBalance selectCustomerBalanceById(Long id);

    /**
     * 查询会员余额列表
     *
     * @param customerBalance 会员余额
     * @return 会员余额集合
     */
    public List<CustomerBalance> selectCustomerBalanceList(CustomerBalance customerBalance);

    /**
     * 新增会员余额
     *
     * @param customerBalance 会员余额
     * @return 结果
     */
    public int insertCustomerBalance(CustomerBalance customerBalance);

    /**
     * 修改会员余额
     *
     * @param customerBalance 会员余额
     * @return 结果
     */
    public int updateCustomerBalance(CustomerBalance customerBalance);

    /**
     * 删除会员余额
     *
     * @param id 会员余额主键
     * @return 结果
     */
    public int deleteCustomerBalanceById(Long id);

    /**
     * 批量删除会员余额
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteCustomerBalanceByIds(Long[] ids);

    /**
     * 查询会员余额
     *
     * @param id 会员主键
     * @return 会员余额
     */
    CustomerBalance selectCustomerBalanceByCustomerId(Long id);

    /**
     * 修改会员余额
     *
     * @param id 会员余额主键
     * @return 会员余额
     */
    int updateBalance(@Param("id") Long id,
                      @Param("amount") BigDecimal amount,
                      @Param("integral") Long integral,
                      @Param("version") Long version,
                      @Param("updateBy") String updateBy,
                      @Param("updateTime") Date updateTime,
                      @Param("level") Integer level
    );
}
